<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pytils.templatetags.pytils_numeral</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pytils-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pytils-module.html">Package&nbsp;pytils</a> ::
        <a href="pytils.templatetags-module.html">Package&nbsp;templatetags</a> ::
        Module&nbsp;pytils_numeral
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript: void(0);" class="privatelink"
    onclick="toggle_private();">hide private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pytils.templatetags.pytils_numeral-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module pytils_numeral</h1><span class="codelink"><a href="pytils.templatetags.pytils_numeral-pysrc.html">source&nbsp;code</a></span><br /><br />
pytils.numeral templatetags for Django web-framework<br /><br />

<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <code class="summary-type">&nbsp;</code>
  </td><td class="summary">
    <span class="summary-sig"><a href="pytils.templatetags.pytils_numeral-module.html#choose_plural" class="summary-sig-name">choose_plural</a>(<span class="summary-sig-arg">amount</span>,
        <span class="summary-sig-arg">variants</span>)</span><br />
      Choose proper form for plural.
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <code class="summary-type">&nbsp;</code>
  </td><td class="summary">
    <span class="summary-sig"><a href="pytils.templatetags.pytils_numeral-module.html#rubles" class="summary-sig-name">rubles</a>(<span class="summary-sig-arg">amount</span>,
        <span class="summary-sig-arg">zero_for_kopeck</span>=<span class="summary-sig-default">False</span>)</span><br />
      Converts float value to in-words representation (for money)
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <code class="summary-type">&nbsp;</code>
  </td><td class="summary">
    <span class="summary-sig"><a href="pytils.templatetags.pytils_numeral-module.html#in_words" class="summary-sig-name">in_words</a>(<span class="summary-sig-arg">amount</span>,
        <span class="summary-sig-arg">gender</span>=<span class="summary-sig-default">None</span>)</span><br />
      In-words representation of amount.
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <code class="summary-type">&nbsp;</code>
  </td><td class="summary">
    <span class="summary-sig"><a href="pytils.templatetags.pytils_numeral-module.html#sum_string" class="summary-sig-name">sum_string</a>(<span class="summary-sig-arg">amount</span>,
        <span class="summary-sig-arg">gender</span>,
        <span class="summary-sig-arg">items</span>)</span><br />
      in_words and choose_plural in a one flask Makes in-words 
      representation of value with choosing correct form of noun.
  </td>
</tr>
</table>

<br />
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <code class="summary-type">&nbsp;</code>
  </td><td class="summary">
    <a href="pytils.templatetags.pytils_numeral-module.html#__revision__">__revision__</a> = <code title="'$Id: pytils_numeral.py 29 2006-10-21 08:28:27Z the.pythy $'">'$Id: pytils_numeral.py 29 2006-10-21 08:28:27Z the....</code>
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <code class="summary-type">&nbsp;</code>
  </td><td class="summary">
    <a href="pytils.templatetags.pytils_numeral-module.html#__id__">__id__</a> = <code title="'$Id: pytils_numeral.py 29 2006-10-21 08:28:27Z the.pythy $'">'$Id: pytils_numeral.py 29 2006-10-21 08:28:27Z the....</code>
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <code class="summary-type">&nbsp;</code>
  </td><td class="summary">
    <a href="pytils.templatetags.pytils_numeral-module.html#__url__">__url__</a> = <code title="'$URL: https://pythy.googlecode.com/svn/trunk/pytils/pytils/templatetags/pytils_numeral.py $'">'$URL: https://pythy.googlecode.com/svn/trunk/pytils...</code>
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <code class="summary-type">&nbsp;</code>
  </td><td class="summary">
    <a href="pytils.templatetags.pytils_numeral-module.html#register">register</a> = <code title="&lt;django.template.Library object at 0xb7ab18ec&gt;">&lt;django.template.Library object at 0xb7ab18ec&gt;</code><br />
      Django template tag/filter registrator
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <code class="summary-type">&nbsp;</code>
  </td><td class="summary">
    <a href="pytils.templatetags.pytils_numeral-module.html#encoding">encoding</a> = <code title="'utf-8'">'utf-8'</code><br />
      Current charset (sets in Django project's settings)
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <code class="summary-type">&nbsp;</code>
  </td><td class="summary">
    <a href="pytils.templatetags.pytils_numeral-module.html#debug">debug</a> = <code title="True">True</code><br />
      Debug mode (sets in Django project's settings)
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <code class="summary-type">&nbsp;</code>
  </td><td class="summary">
    <a href="pytils.templatetags.pytils_numeral-module.html#show_value">show_value</a> = <code title="False">False</code><br />
      Show values on errors (sets in Django project's settings)
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <code class="summary-type">&nbsp;</code>
  </td><td class="summary">
    <a href="pytils.templatetags.pytils_numeral-module.html#default_value">default_value</a> = <code title="'unknown: %(error)s'">'unknown: %(error)s'</code>
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <code class="summary-type">&nbsp;</code>
  </td><td class="summary">
    <a href="pytils.templatetags.pytils_numeral-module.html#default_uvalue">default_uvalue</a> = <code title="u'unknown: %(error)s'">u'unknown: %(error)s'</code>
  </td>
</tr>
</table>

<br />
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="choose_plural"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">choose_plural</span>(<span class="sig-arg">amount</span>,
        <span class="sig-arg">variants</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pytils.templatetags.pytils_numeral-pysrc.html#choose_plural">source&nbsp;code</a></span>&nbsp;</span
    ></td>
  </table>
  
  <p>Choose proper form for plural.</p>
  <p>Value is a amount, parameters are forms of noun. Forms are variants 
  for 1, 2, 5 nouns. It may be tuple of elements, or string where variants 
  separates each other by comma.</p>
  Examples:
<pre class="literalblock">
   {{ some_int|choose_plural:&quot;&#1087;&#1088;&#1080;&#1084;&#1077;&#1088;,&#1087;&#1088;&#1080;&#1084;&#1077;&#1088;&#1072;,&#1087;&#1088;&#1080;&#1084;&#1077;&#1088;&#1086;&#1074;&quot; }}
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>
</div>
<a name="rubles"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">rubles</span>(<span class="sig-arg">amount</span>,
        <span class="sig-arg">zero_for_kopeck</span>=<span class="sig-default">False</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pytils.templatetags.pytils_numeral-pysrc.html#rubles">source&nbsp;code</a></span>&nbsp;</span
    ></td>
  </table>
  
  Converts float value to in-words representation (for money)
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>
</div>
<a name="in_words"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">in_words</span>(<span class="sig-arg">amount</span>,
        <span class="sig-arg">gender</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pytils.templatetags.pytils_numeral-pysrc.html#in_words">source&nbsp;code</a></span>&nbsp;</span
    ></td>
  </table>
  
  <p>In-words representation of amount.</p>
  <p>Parameter is a gender: 1=male, 2=female, 3=neuter</p>
  Examples:
<pre class="literalblock">
   {{ some_int|in_words }}
   {{ some_other_int|in_words:2 }}
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>
</div>
<a name="sum_string"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">sum_string</span>(<span class="sig-arg">amount</span>,
        <span class="sig-arg">gender</span>,
        <span class="sig-arg">items</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pytils.templatetags.pytils_numeral-pysrc.html#sum_string">source&nbsp;code</a></span>&nbsp;</span
    ></td>
  </table>
  
  <p>in_words and choose_plural in a one flask Makes in-words 
  representation of value with choosing correct form of noun.</p>
  <p>First parameter is an amount of objects. Second is a gender (1=male, 
  2=female, 3=neuter). Third is a variants of forms for object name.</p>
  Examples:
<pre class="literalblock">
   {% sum_string some_int 1 &quot;&#1087;&#1088;&#1080;&#1084;&#1077;&#1088;,&#1087;&#1088;&#1080;&#1084;&#1077;&#1088;&#1072;,&#1087;&#1088;&#1080;&#1084;&#1077;&#1088;&#1086;&#1074;&quot; %}
   {% sum_string some_other_int 2 &quot;&#1079;&#1072;&#1076;&#1072;&#1095;&#1072;,&#1079;&#1072;&#1076;&#1072;&#1095;&#1080;,&#1079;&#1072;&#1076;&#1072;&#1095;&quot; %}
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>
</div>
<br />
<!-- ==================== VARIABLES DETAILS ==================== -->
<a name="section-VariablesDetails"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-VariablesDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__revision__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">__revision__</h3>
  None
  <dl><dt></dt><dd>
    <dl><dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
<span class="variable-quote">'</span>$Id: pytils_numeral.py 29 2006-10-21 08:28:27Z the.pythy $<span class="variable-quote">'</span>           
      </pre></td></tr></table></dd>
    </dl>
  </dd></dl>
</td></tr></table>
</div>
<a name="__id__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">__id__</h3>
  None
  <dl><dt></dt><dd>
    <dl><dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
<span class="variable-quote">'</span>$Id: pytils_numeral.py 29 2006-10-21 08:28:27Z the.pythy $<span class="variable-quote">'</span>           
      </pre></td></tr></table></dd>
    </dl>
  </dd></dl>
</td></tr></table>
</div>
<a name="__url__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">__url__</h3>
  None
  <dl><dt></dt><dd>
    <dl><dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
<span class="variable-quote">'</span>$URL: https://pythy.googlecode.com/svn/trunk/pytils/pytils/templateta<span class="variable-linewrap"><img src="crarr.png" alt="" /></span>
gs/pytils_numeral.py $<span class="variable-quote">'</span>                                                
      </pre></td></tr></table></dd>
    </dl>
  </dd></dl>
</td></tr></table>
</div>
<a name="register"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">register</h3>
  Django template tag/filter registrator
  <dl><dt></dt><dd>
    <dl><dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
&lt;django.template.Library object at 0xb7ab18ec&gt;                         
      </pre></td></tr></table></dd>
    </dl>
  </dd></dl>
</td></tr></table>
</div>
<a name="encoding"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">encoding</h3>
  Current charset (sets in Django project's settings)
  <dl><dt></dt><dd>
    <dl><dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
<span class="variable-quote">'</span>utf-8<span class="variable-quote">'</span>                                                                
      </pre></td></tr></table></dd>
    </dl>
  </dd></dl>
</td></tr></table>
</div>
<a name="debug"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">debug</h3>
  Debug mode (sets in Django project's settings)
  <dl><dt></dt><dd>
    <dl><dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
True                                                                   
      </pre></td></tr></table></dd>
    </dl>
  </dd></dl>
</td></tr></table>
</div>
<a name="show_value"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">show_value</h3>
  Show values on errors (sets in Django project's settings)
  <dl><dt></dt><dd>
    <dl><dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
False                                                                  
      </pre></td></tr></table></dd>
    </dl>
  </dd></dl>
</td></tr></table>
</div>
<a name="default_value"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">default_value</h3>
  None
  <dl><dt></dt><dd>
    <dl><dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
<span class="variable-quote">'</span>unknown: %(error)s<span class="variable-quote">'</span>                                                   
      </pre></td></tr></table></dd>
    </dl>
  </dd></dl>
</td></tr></table>
</div>
<a name="default_uvalue"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">default_uvalue</h3>
  None
  <dl><dt></dt><dd>
    <dl><dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
u'unknown: %(error)s'                                                  
      </pre></td></tr></table></dd>
    </dl>
  </dd></dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pytils-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">Generated by Epydoc
        3.0alpha3 on Sun Oct 29 00:35:02 2006</td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
